package org.suk.dp.iterator;

import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;

/**
 * Description: 客户端<br/>
 * @version V1.0  2017/6/21 16:26  by 石冬冬(dongdong.shi@ucarinc.com) - Heil Hitler
 */
public class Client {
    public static void main(String[] args) {
        ConcreteAggregate aggregate = new ConcreteAggregate();
        List<Object> items = new ArrayList<Object>(){{
            add("弗洛斯");add("亚塔奇");add("罗萨梅");add("台币罗");add("拉瓦斯");add("台撒");
        }};
        aggregate.setItems(items);
        Iterator it = new ConcreteIteratorDesc(aggregate);
        while(it.hasNext()){
            System.out.println(MessageFormat.format("{0} 请买车票",it.currentItem()));
            it.next();
        }
    }
}
